package com.ruoyi.project.men.service.impl;


import com.ruoyi.common.utils.bootdo.R;
import com.ruoyi.project.men.dao.MenMapCountDao;
import com.ruoyi.project.men.dao.MenMapInfoDao;
import com.ruoyi.project.men.domain.MenMapInfoDO;
import com.ruoyi.project.men.service.MenMapInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;


@Service
public class MenMapInfoServiceImpl implements MenMapInfoService {
	@Autowired
	private MenMapInfoDao menMapInfoDao;
	@Autowired
	private MenMapCountDao menMapCountDao;
	
	@Override
	public MenMapInfoDO get(String id){
		return menMapInfoDao.get(id);
	}
	
	@Override
	public List<MenMapInfoDO> list(Map<String, Object> map){
		return menMapInfoDao.list(map);
	}
	
	@Override
	public int count(Map<String, Object> map){
		return menMapInfoDao.count(map);
	}
	
	@Override
	public int save(MenMapInfoDO menMapInfo){
		return menMapInfoDao.save(menMapInfo);
	}
	
	@Override
	public int update(MenMapInfoDO menMapInfo){
		return menMapInfoDao.update(menMapInfo);
	}
	
	@Override
	public int remove(String id){
		return menMapInfoDao.remove(id);
	}
	
	@Override
	public int batchRemove(String[] ids){
		return menMapInfoDao.batchRemove(ids);
	}

    @Override
    public List<MenMapInfoDO> likeList(Map<String, Object> map){
        return menMapInfoDao.likeList(map);
    }
    @Override
    public int likeListCount(Map<String, Object> map){
        return menMapInfoDao.likeListCount(map);
    }

    @Override
    public R getMapInfo() {
		Map<String,Object> countMap = menMapCountDao.getMapCount();
		Map<String,Object> map = new HashMap<>();
		map.put("delFlag","0");
		map.put("sotr","ca_at");
		map.put("order","desc");
		List<MenMapInfoDO> list = menMapInfoDao.list(map);
		countMap.put("infoList",list);
		return R.ok().put("data",countMap);
    }

}
